/**
 * snes.h
 *
 * Contains all general SNES interfaces and inter-module data structures
 * 
 * @author  Philippe Johnson
 */

#ifndef __SNES_H__
#define __SNES_H__

#include "common.h"
#include "rommanager.h"

typedef struct _CartridgeInfo {
    u16         sramSize;
    u16         romSize;
    u16         resetVector;
    u16         nmiVector;
    ROMTYPE     romType;
    ROMSPEED    romSpeed;
} CartridgeInfo; 

/**
 * initializeSNES
 * Initializes all components of the SNES.
 *
 * @return TRUE if success, FALSE otherwise
 */
BOOL initializeSNES();

/**
 * uninitializeSNES
 * Free all resources associated with the SNES.
 */
void uninitializeSNES();

/**
 * runSNES
 * Run the loaded ROM, manage the synchronization of all components, etc.
 */
void runSNES();

/**
 * loadCartridge -- module-specific?
 * Initializes all ROM/Cartridge-oriented facilities and obtains information on
 * ROM
 * 
 * @param filename The name of the ROM to load.
 * @param info     Pointer to the CartridgeInfo struct to fill out
 * @return TRUE if success, FALSE otherwise
 */
BOOL loadCartridge( char* filename, CartridgeInfo* info );

#endif /* __SNES_H__ */
